package com.cnhis.cloudhealth.clinical.clidoctor.basicinformationquery.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.cnhis.cloudhealth.clinical.clidoctor.basicinformationquery.bo.BasicInformationQueryBo;
import com.cnhis.cloudhealth.clinical.clidoctor.cliregistration.bo.RegistBo;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;
import com.cnhis.cloudhealth.commons.newid.GetNewId;
import com.cnhis.cloudhealth.commons.utils.GlobalVariable;
import com.cnhis.cloudhealth.commons.utils.StaticKeys;
import com.cnhis.cloudhealth.rate.base.vac1.bo.RateVac1Bo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Service
public class BasicInformationQueryImpl implements IBasicInformationQuery {
   @Autowired
   private BasicInformationQueryBo basicInformationQueryBo;
   @Autowired
   private RateVac1Bo rateVacBo;
   @Autowired
   private RegistBo registBo;
   @Autowired
   private GetNewId getNewId;

@Override
public ModelVo treatmentItemQuery(Map map) throws Exception {
	return basicInformationQueryBo.treatmentItemQuery(map);
}

@Override
public ModelVo queryPrescriptionType(int currPage, int pageSize)
		throws Exception {
	return basicInformationQueryBo.queryPrescriptionType(currPage, pageSize);
}

@Override
public ModelVo illnessDirectory(Map map, int currPage, int pageSize)
		throws Exception {
	
	return basicInformationQueryBo.illnessDirectory(map, currPage, pageSize);
}

@Override
public ModelVo chineseMedicineTreatment(int currPage, int pageSize)
		throws Exception {
	
	return basicInformationQueryBo.chineseMedicineTreatment(currPage, pageSize);
}

@Override
public ModelVo feeItem(Map map, int currPage, int pageSize) throws Exception {
	return basicInformationQueryBo.feeItem(map, currPage, pageSize);
}

@Override
public ModelVo defaultPharmacy(Map map, int currPage, int pageSize)
		throws Exception {
	return basicInformationQueryBo.defaultPharmacy(map, currPage, pageSize);
}

@Override
public ModelVo zhixingkeshi1(HashMap map)
    throws Exception
{
    return basicInformationQueryBo.zhixingkeshi1(map);
}

@Override
public ModelVo updatehoratevac1modify(Map paramMap, Long vAC01)
    throws Exception
{
    Map map = registBo.convertJson(GlobalVariable.StringIsNull(paramMap.get("mydata")));
    return rateVacBo.updatehoratevac1modify(vAC01,map);
}

@Override
public ModelVo updateVaaVacVcj(Map paramMap, Long vAC01)
    throws Exception
{
    Map map = registBo.convertJson(GlobalVariable.StringIsNull(paramMap.get("mydata")));
    return basicInformationQueryBo.updateVaaVacVcj(vAC01,map);
}

@Override
public ModelVo getBciInfo(Map<String, Object> map)
    throws Exception
{
    return basicInformationQueryBo.getBciInfo(map);
}

    @Override
    public ModelVo queryBase(Map<String, Object> paramMap) throws Exception
    {
        return basicInformationQueryBo.queryBase(paramMap);
    }

    @Override
    public ModelVo updateProc(Map<String, Object> map)
        throws Exception
    {
        return basicInformationQueryBo.updateProc(map);
    }

    @Override
    public ModelVo updateProc1(Map<String, Object> map)
        throws Exception
    {
        return basicInformationQueryBo.updateProc1(map);
    }

    @Override
    public ModelVo queryNewId(Map<String, Object> paramMap)
        throws Exception
    {
        int count = (GlobalVariable.IntegerIsNull(paramMap.get("count"), 1));
        List<Long> idList = getNewId.nextId(count);
        List<String> idLists = new ArrayList<String>(idList.size());
        for(Long id : idList)
        {
            idLists.add(id+"");
        }
        ModelVo mv = new ModelVo();
        mv.setResult(StaticKeys.OH_SUCCESS);
        mv.setList(idLists);
        return mv;
    }

    @Override
    public ModelVo basequeryPage(Map<String, Object> paramMap)
        throws Exception
    {
        return basicInformationQueryBo.queryBasePage(paramMap);
    }

}
